//
//  ViewController.m
//  web
//
//  Created by iD Student on 7/3/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize web;

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [self setWeb:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {
        return YES;
    }
}
-(IBAction)change:(id)sender{
    choose=[sender tag];
    address1=@"http://www.google.com";
    address2=@"http://www.internaldrive.com";
    address3=@"http://www.apple.com";
    switch (choose) {
        case 0:
            url=[NSURL URLWithString:address1];
                 requestObj=[NSURLRequest requestWithURL:url];
            break;
        case 1:
            url=[NSURL URLWithString:address2];
            requestObj=[NSURLRequest requestWithURL:url];
            break;
        case 2:
            url=[NSURL URLWithString:address3];
            requestObj=[NSURLRequest requestWithURL:url];
            break;

    }
    [web loadRequest:requestObj];

}
@end
